package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/11/7
 */
@Entity
@Table(name = "draw_after_do_log")
public class DrawAfterDoLogEntity extends BaseEntity{
    public enum DrawAfterDoLogEntity_{
        drawNo,resultCode,activityCode
    }
    private String activityCode;
    private String prizeCode;
    private String drawNo;
    private String resultCode;
    private String errorMsg;

    @Basic
    @Column(name = "activity_code")
    public String getActivityCode() {
        return activityCode;
    }

    public void setActivityCode(String activityCode) {
        this.activityCode = activityCode;
    }

    @Basic
    @Column(name = "prize_code")
    public String getPrizeCode() {
        return prizeCode;
    }

    public void setPrizeCode(String prizeCode) {
        this.prizeCode = prizeCode;
    }

    @Basic
    @Column(name = "draw_no")
    public String getDrawNo() {
        return drawNo;
    }

    public void setDrawNo(String drawNo) {
        this.drawNo = drawNo;
    }

    @Basic
    @Column(name = "result_code")
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    @Basic
    @Column(name = "error_msg")
    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DrawAfterDoLogEntity that = (DrawAfterDoLogEntity) o;

        if (activityCode != null ? !activityCode.equals(that.activityCode) : that.activityCode != null) return false;
        if (prizeCode != null ? !prizeCode.equals(that.prizeCode) : that.prizeCode != null) return false;
        if (drawNo != null ? !drawNo.equals(that.drawNo) : that.drawNo != null) return false;
        if (resultCode != null ? !resultCode.equals(that.resultCode) : that.resultCode != null) return false;
        return errorMsg != null ? errorMsg.equals(that.errorMsg) : that.errorMsg == null;
    }

    @Override
    public int hashCode() {
        int result = activityCode != null ? activityCode.hashCode() : 0;
        result = 31 * result + (prizeCode != null ? prizeCode.hashCode() : 0);
        result = 31 * result + (drawNo != null ? drawNo.hashCode() : 0);
        result = 31 * result + (resultCode != null ? resultCode.hashCode() : 0);
        result = 31 * result + (errorMsg != null ? errorMsg.hashCode() : 0);
        return result;
    }
}
